home *** CD-ROM | disk | FTP | other *** search
-
- {
- if(true)
- {
- CShotArtilleryShell = §§newclass(CShotArtilleryShell,CShot);
- }
- }
-
- package Local.Game.Thing
- {
- import Local.Game.World.*;
- import Local.Game.World.Map.*;
- import Local.Game.World.Map.Cell.*;
- import Local.Math.*;
- import STC9.System.*;
- import flash.display.*;
- import flash.events.*;
- import flash.geom.*;
-
- public class CShotArtilleryShell extends CShot
- {
-
-
- private var mPath:CPath;
-
- public function CShotArtilleryShell(param1:CPosition, param2:Number = -200)
- {
- var _loc3_:CPosition = null;
- _loc3_ = new CPosition();
- §§push(_loc3_);
- §§push(param1.x - 2000);
- if(true)
- {
- §§push(§§pop() - Math.random() * 500);
- }
- §§pop().x = §§pop();
- §§push(_loc3_);
- §§push(param2);
- if(true)
- {
- §§push(§§pop() + (Math.random() * 150 + 20));
- }
- §§pop().y = §§pop();
- super(_loc3_);
- mType = "artilleryshell";
- Process = Process_Normal;
- mAngle = new CAngle();
- §§push(§§findproperty(mMaxSpeed));
- §§push(150 + Math.random() * 30);
- if(true)
- {
- §§push(§§pop() * mSpriteScalar);
- }
- §§pop().mMaxSpeed = §§pop();
- mSpeed = mMaxSpeed;
- mAcceleration = 1;
- mOrientation = 1;
- mMaxLife = mLife = 1;
- AddAnimation("stand",Artillery_Shell,"AddSprite_Black");
- mShowOnMap = true;
- mTarget = param1;
- SetState("FOLLOWPATH");
- }
-
- public function State_FOLLOWPATH_Enter() : void
- {
- if(true)
- {
- mPath = new CPath();
- if(true)
- {
- §§push(mPath);
- if(true)
- {
- §§pop().SetPath([mPosition,new Point((mPosition.x + mTarget.x) * 0.6,mPosition.y),mTarget]);
- addr49:
- §§push(mPath);
- }
- §§pop().OrientateThing(this);
- §§goto(addr52);
- }
- §§goto(addr49);
- }
- addr52:
- }
-
- public function State_FOLLOWPATH_Exit() : void
- {
- }
-
- public function State_NOPATH() : void
- {
- mDelta = CPosition.NORMALIZE(mAngle.mDelta,mSpeed);
- mPosition.Add(mDelta);
- }
-
- override public function Draw() : void
- {
- var _loc1_:Matrix = null;
- super.Draw();
- DrawTrail(3,90);
- _loc1_ = GetOrientationMatrix();
- DrawSprite(_loc1_);
- }
-
- public function Process_Normal() : void
- {
- var _loc1_:Point = null;
- Accelerate_Speed();
- if(Process_State != null)
- {
- Process_State();
- }
- if(MapMoveTrail())
- {
- Process_ReachedObjective();
- }
- _loc1_ = OrientatePoint(mSprite.mObjects["payload"].mPosition.clone(),mPosition);
- if(_loc1_.y >= mLandscape.GetAltitude(_loc1_.x))
- {
- AddThing(new CEffectExplosionLarge(new CPosition(_loc1_.x,mLandscape.GetAltitude(_loc1_.x))));
- mDead = true;
- }
- if(mDead)
- {
- DispatchDispose();
- }
- }
-
- public function State_NOPATH_Exit() : void
- {
- }
-
- public function State_NOPATH_Enter() : void
- {
- }
-
- public function State_FOLLOWPATH() : void
- {
- if(!mPath.MoveAlong(mSpeed))
- {
- SetState("NOPATH");
- Process_State();
- return;
- }
- mPath.OrientateThing(this);
- }
- }
- }
-